<!-- <!DOCTYPE html>
<html>
<body>
  <form method="POST" action="search.php">
    <center><input type="text" name="ctf_title" class="form-control" placeholder="Search">
        <button type="submit" class="btn btn-default">搜索</button></center>
  </form>
</body>
</html> -->

<?php
header("Content-type: text/html; charset=utf-8");
require_once('inc_jiaju.php');
connect();
$sql = 'select jiaju.*,category.ctf_cname from jiaju left join category on jiaju.ctf_cid=category.ctf_cid';
$jiaju = fetch_array($sql);
//var_dump($jiaju);
echo '<table align="center" border="1">';
echo '<caption><h2>家具</h2></caption>';
echo '<tr>
<th>序号</th>
<th>图片</th>
<th>名称</th>
<th>品牌</th>
<th>所属类别</th>
<th>添加时间</th>
<th>操作</th>
</tr>';
foreach ($jiaju as $one) {
  echo '<tr>';
  echo '<td>'.$one['ctf_id'].'</td>';
  echo '<td align="center"><a href="detail.php?id='.$one['ctf_id'].'">
      <img src='.$one['ctf_jiajulink'].' width=100 height=90 alt="无图片"></td>';
  echo '<td>'.$one['ctf_name'].'</td>';
  echo '<td>'.$one['ctf_brand'].'</td>';
  echo '<td>'.$one['ctf_cname'].'</td>';
  echo '<td>'.$one['ctf_adddate'].'</td>';
  echo '<td><a href="jiajuEditForm.php? id='.$one['ctf_id'].' ">修改</a> | 
   <a href="del.php?id='.$one['ctf_id'].'" onClick="return confirm(\'确定要删除吗？\');">
   删除</a></td>';
  echo '</tr>';
}

?>